﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Register Src="../Shared/Header.ascx" TagName="Header" TagPrefix="uc1" %>
<!DOCTYPE html>

<html>
<head runat="server">
    <title>条码查询</title>
    <uc1:Header ID="Header1" runat="server" />
    <script type="text/javascript" language="javascript">
        $(function () {
            $("#TiaoMH").change(function () {
                submit();
            });
        });

        function reset() {
            $("#TiaoMH").val("");
        }

        var hasquery = false;
        function submit() {
            var strTiaoMH = $("#TiaoMH").val();
            strTiaoMH = strTiaoMH.replace(/[，]/gi, ",");
            if (strTiaoMH != "") {
                if (!hasquery) {
                    $('#grid').datagrid({
                        iconCls: 'icon-save',
                        nowrap: false,                      //设置为true，当数据长度超出列宽时将会自动截取
                        striped: true,                      //奇偶行使用不同背景色
                        url: '/Query/LoadIndex3/',   //从远程站点请求数据的 URL
                        fitColumns: true,                   //适应表格的宽度并且防止水平滚动
                        fit: true,
                        idField: 'Id',                      //标识字段
                        remoteSort: false,                  //定义是否从服务器给数据排序
                        singleSelect: true,                 //是否允许选中一行
                        pagination: false,                  //分页
                        rownumbers: true,                    //行号    
                        queryParams: { TiaoMH: strTiaoMH }
                    });
                    hasquery = true;
                }
                else {
                    setColumn(strTiaoMH);
                }
            }
            else {
                setColumn("-999999");
            }
        }

        function setColumn(strTiaoMH) {
            var options = $('#grid').datagrid('options');
            if (options) {
                options.queryParams = {
                    TiaoMH: strTiaoMH
                };
                $('#grid').datagrid(options);
                $('#grid').datagrid("load");
            }
        }
    </script>
</head>
<body class="easyui-layout">
    <div id="north_Index1" region="north" style="padding:5px;" border="false"> 
        <table style="width:100%; background-color:#EFEFEF; font-size:12px;" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td colspan="2" style="border-bottom:1px solid #CCCCCC; line-height:2;"><span style="padding-left:10px;">请输入你要查询的条件：</span></td>
                <td style="border-bottom:1px solid #CCCCCC;">                    
                </td>
            </tr>
            <tr>
                <td style="text-align: right; width: 80px;padding:2px 0;">条码号：</td>
                <td style="text-align: left; width: 120px;padding:2px 0;">
                    <input id="TiaoMH" type="text" name="TiaoMH" style="width:140px;">
                </td>
                <td style="">
                    <a id="btnQuery" href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-search" plain="true" onclick="submit()">查询</a>
                    <a id="btnReset" href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-redo" plain="true" onclick="reset()">重写</a> 
                </td>
            </tr>
        </table>                
    </div>
    <div region="center" style="padding: 0 5px 5px 5px;" border="false">        
        <table id="grid" style="display:none">
            <thead>
                <tr>
                    <th field="TiaoMH" width="9%">条码号</th>
                    <th field="BaoMC" width="8%">包名称</th>
                    <th field="BaoZR" width="8%">包装人</th>
                    <th field="BaoZRQ" width="10%">包装日期</th>
                    <th field="BaoZSJ" width="8%" formatter="formatDate">包装时间</th>
                    <th field="MieJR" width="8%">灭菌人</th>                    
                    <th field="MieJRQ" width="10%">灭菌日期</th> 
                    <th field="MieJSJ" width="8%" formatter="formatDate">灭菌时间</th> 
                    <th field="YouXQ" width="8%">有效期</th>
                    <th field="LingYKS" width="8%">领用科室</th>
                    <th field="LingYR" width="9%" formatter="lingyrFormatter">领用人</th>
                    <th field="ShiYR" width="9%" formatter="lingyrFormatter">使用人</th>                 
                    <th field="FaFRQ" width="10%">发放日期</th>
                    <th field="FaFSJ" width="8%" formatter="formatDate">发放时间</th>
                    <th field="FaFR" width="9%">发放人</th>
                    <th field="ShiXSJ" width="10%">失效日期</th>
                    <th field="HuiSR" width="12%">回收人/清洗人</th>                    
                    <th field="HuiSRQ" width="10%">回收日期</th> 
                    <th field="HuiSSJ" width="8%" formatter="formatDate">回收时间</th>  
                    <th field="ZhuangT" width="6%"  formatter="zhuangtFormatter">状态</th>
                </tr>
            </thead>
        </table>
    </div>
    <div id="win" />
</body>
</html>
